import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index'
import menu from '../components/menu'
import marketMenu from '../components/marketMenu'
import targetMarketIndex from '../components/targetMarket/index'
import targetMarketGet from '../components/targetMarket/get'

import targetMarketCompetitive from '../components/targetMarket/competitive'
import targetMarketIncome from '../components/targetMarket/income'
import targetMarketDraft from '../components/targetMarket/draft'
import trendsIndex from '../components/targetMarket/trendsIndex/index'
import customMarket from '../components/targetMarket/trendsIndex/customMarket'
import showMarket from '../components/targetMarket/trendsIndex/showMarket'
import macroInfo from '../components/targetMarket/trendsIndex/macroInfo'
import trendAnalysis from '../components/targetMarket/trendsIndex/trendAnalysis'
import opportunityDetails from '../components/targetMarket/trendsIndex/opportunityDetails'
import trendInfluence from '../components/targetMarket/trendsIndex/trendInfluence'
import checkMarket from '../components/targetMarket/trendsIndex/checkMarket'
import full from '../components/full'
import organization from './organization/menu'
import organizationList from './organization/list'
import PostManagement from './organization/post-management'
import PositionManagement from './organization/position-management'
import UserManagement from './organization/user-management'
import PermissionManagement from './organization/permission-management'
import UserPermission from './organization/user-permission'
import InviteUser from './organization/invite-user'
import ProductionManagement from './organization/production-management'
import ProductionManagementEditor from './organization/production-management-editor'
import login from './sign/index'
import resetPassword from './sign/resetPassword'
import signUp from './sign/signUp'
import enterpriseSignUp from './sign/enterpriseSignUp'
import part1 from './sign/part1'
import part2 from './sign/part2'
import part3 from './sign/part3'

/**
* @desc: This is Note
* 营销透视路由列表
* @author: WJ
* @date: 2018/10/31 21:25:56
*/
import marketSale from './marketSale/marketSale'
import totalPanel from './marketSale/productCapabilityAnalysis/productMarket/totalPanel'
import catagoryItem from './marketSale/productCapabilityAnalysis/productMarket/catagoryItem'
import modelDetailDialog from './marketSale/productCapabilityAnalysis/productMarket/modelDetailDialog'
import detailPanel from './marketSale/productCapabilityAnalysis/detailPanel/detailPanel'
import singleProduct from './marketSale/productCapabilityAnalysis/singleProduct/singleProduct'
import channelTotal from './marketSale/marketingCapabilityAnalysis/ChannelTotal/marketingChannelTotal'
import analysisDetail from './marketSale/marketingCapabilityAnalysis/analysisDetail/marketingAnalysisDetail'
import monitoringTracking from './marketSale/marketingCapabilityAnalysis/monitoringAndTracking/marketingMonitoringAndTracking'
import optimizationIndex from './marketSale/productChannelOptimization/optimization/optimizationIndex'
import productFileMangement from './marketSale/productFileManagement/productFileMangement.vue'
import channelManagement from './marketSale/channelManagement/channelMangement.vue'
import shopManagement from './marketSale/shopManagement/shopManagement.vue'
import newProductLanunchPlan from './marketSale/marketingPlanning/newProductLanunchPlan.vue'
import productFileMangementDetail from './marketSale/productFileManagement/productFileMangementDetail.vue'
import newProductDetails from './marketSale/marketingPlanning/newProductDetails.vue'
import productTotalView from './marketSale/newProductLaunchPlan/productTotalView/productTotalView'
import dataUpdate from './marketSale/newProductLaunchPlan/dataUpdate/dataUpdate'
import testSales from './marketSale/newProductLaunchPlan/dataUpdate/testSales'
import overAllDeploymentPlan from './marketSale/newProductLaunchPlan/overAllDeploymentPlan/overAllDeploymentPlan'
import deploymentPlanDetail from './marketSale/newProductLaunchPlan/overAllDeploymentPlan/deploymentPlanDetail'
import rhymePlanDetail from './marketSale/newProductLaunchPlan/overAllRhythmPlan/rhymePlanDetail'
import overAllRhythmPlan from './marketSale/newProductLaunchPlan/overAllRhythmPlan/overAllRhythmPlan'
import productQuene from './marketSale/newProductLaunchPlan/productQuene/productQuene'
import prodQueneDetail from './marketSale/newProductLaunchPlan/productQuene/prodQueneDetail'
import marketPlan from './marketSale/marketingPlanning/marketPlanS/marketPlan.vue'
import monthPlan from './marketSale/marketingPlanning/marketPlanS/monthPlan'
import yearPlan from './marketSale/marketingPlanning/marketPlanS/yearPlan'
import annualPlan from './marketSale/marketingPlanning/marketPlanS/annualPlan'
import newYearPlan from './marketSale/marketingPlanning/marketPlanS/newYearPlan'
import newMonthPlan from './marketSale/marketingPlanning/marketPlanS/newMonthPlan'
import planYearDetail from './marketSale/marketingPlanning/marketPlanS/yearProductList'
import monthProdList from './marketSale/marketingPlanning/marketPlanS/monthProductList'


Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      component: index,
      meta: {
        requiresAuth: true,
      },
    },
    {
      path: '/full',
      name: 'full',
      component: full,
      meta: {
        requiresAuth: true,
      },
      children:
        [
          {
            path: '/',
            name: 'trendsIndex',
            component: trendsIndex,
          },
          {
            path: 'marketMenu',
            name: 'marketMenu',
            component: marketMenu,
            children: [
              // {path: 'targetMarketIndex', component: targetMarketIndex},
              // {path: 'targetMarketTrends', component: trendsIndex},
             {path: 'targetMarketTrends/customMarket', component: customMarket},
             {path: 'targetMarketTrends/showMarket', component: showMarket},
              {path: 'targetMarketTrends/opportunityDetails/macroInfo', component: macroInfo},
              {path: 'targetMarketTrends/opportunityDetails/macroInfo/trendAnalysis', component: trendAnalysis},
              {path: 'targetMarketTrends/opportunityDetails/trendInfluence/checkMarket', component: checkMarket},
              {path: 'targetMarketTrends/opportunityDetails', component: opportunityDetails},
              {path: 'targetMarketTrends/opportunityDetails/trendInfluence', component: trendInfluence},
              {path: 'targetMarketGet', component: targetMarketGet},
              {path: 'targetMarketCompetitive', component: targetMarketCompetitive},
              {path: 'targetMarketIncome', component: targetMarketIncome},
              {path: 'targetMarketDraft', component: targetMarketDraft}
            ]

          },
          /*
              * 数据采集
              * */
          {
            path: 'menu',
            name: 'menu',
            component: menu,
            children:
              [
                ,{path: 'DAQOnlinePublicOpinion',component: resolve => require(['../components/DAQ/OnlinePublicOpinion.vue'], resolve)}
                ,{path: 'DAQOnlinePublicCommentDetail',component: resolve => require(['../components/DAQ/OnlinePublicCommentDetail.vue'], resolve)}

                ,{path: 'DAQOnlineSale',component: resolve => require(['../components/DAQ/OnlineSale.vue'], resolve)}
                ,{path: 'DAQOnlineSaleDatail/:shopId/:productId',component: resolve => require(['../components/DAQ/OnlineSaleDatail.vue'], resolve)}

                ,{path: 'DAQAfterSale',component: resolve => require(['../components/DAQ/AfterSale.vue'], resolve)}
                ,{path: 'DAQOfflineSale',component: resolve => require(['../components/DAQ/OfflineSale.vue'], resolve)}
                ,{path: 'DAQMarketResearch',component: resolve => require(['../components/DAQ/MarketResearch.vue'], resolve)}
                ,{path: 'DAQUserInterview',component: resolve => require(['../components/DAQ/UserInterview.vue'], resolve)}
                ,{path: 'DAQFeedback',component: resolve => require(['../components/DAQ/Feedback.vue'], resolve)}
                ,{path: 'DAQQuestionnaire',component: resolve => require(['../components/DAQ/Questionnaire.vue'], resolve)}
              ]
          },
          {
            path: 'marketSale',
            redirect: 'totalPanel',
            name: 'marketSale',
            component: marketSale,
            children:[
              {path: 'totalPanel', component: totalPanel, name : 'totalPanel' },
              {path: 'detailPanel', component: detailPanel, name : 'detailPanel' },
              {path: 'catagoryItem', component: catagoryItem, name : 'catagoryItem' },
              {path: 'modelDetailDialog', component: modelDetailDialog , name : 'modelDetailDialog'},
              {path: 'singleProduct', component: singleProduct, name : 'singleProduct'},
              {path: 'channelTotal', component: channelTotal, name : 'channelTotal'},
              {path: 'channelDetail', component: analysisDetail, name : 'analysisDetail'},
              {path: 'monitoringTracking', component: monitoringTracking, name : 'monitoringTracking'},
              {path: 'optimizationIndex', component: optimizationIndex, name: 'optimizationIndex'},
              {path: 'productFileMangement', component: productFileMangement, name: 'productFileMangement'},
              {path: 'channelManagement', component: channelManagement, name: 'channelManagement'},
              {path: 'shopManagement', component: shopManagement, name: 'shopManagement'},
              {path: 'newProductLanunchPlan', component: newProductLanunchPlan, name: 'newProductLanunchPlan'},
              {path: 'productFileMangementDetail/:code', component: productFileMangementDetail, name: 'productFileMangementDetail'},
              {path: 'newProductDetails', component: newProductDetails, name: 'newProductDetails'},
              {path:'productTotalView',component:productTotalView,name:'productTotalView'},
              {path:'dataUpdate',component:dataUpdate,name:'dataUpdate'},
              {path:'testSales/:code',component:testSales,name:'testSales'},
              {path:'overAllDeploymentPlan',component:overAllDeploymentPlan,name:'overAllDeploymentPlan'},
              {path:'overAllRhythmPlan',component:overAllRhythmPlan,name:'overAllRhythmPlan'},
              {path:'productQuene',component:productQuene,name:'productQuene'},
              { path: 'marketPlan', component: marketPlan, name: 'marketPlan',meta:{ isYear: true },children:[
                {
                  path:'monthPlan',component:monthPlan,name:'monthPlan'
                },{
                  path:'yearPlan',component:yearPlan,name:'yearPlan',meta:{ isYear: true }
                },{
                  path:'annualPlan/:mineYear',component:annualPlan,name:'annualPlan',meta:{ isYear: true }
                },{
                  path:'newYearPlan',component:newYearPlan,name:'newYearPlan',meta:{ isYear: true }
                },
                {
                  path:'editYearPlan/:mineYear/:draftId',component:newYearPlan,name:'editYearPlan',meta:{ isYear: true }
                }, {
                  path:'planYearDetail/:mineYear/:draftId',component:planYearDetail,name:'planYearDetail',meta:{ isYear: true }
                },{
                  path:'newMonthPlan',component:newMonthPlan,name:'newMonthPlan'
                },{
                    path:'editMonthPlan/:monthPlan/:draftStatus',component:newMonthPlan,name:'editMonthPlan'
                },{
                  path:'monthProdList/:monthPlan/:draftStatus',component:monthProdList,name:'monthProdList'
                }
              ]},
            ],
          },
          {
            path: 'deploymentPlanDetail/:productId',
            name: 'deploymentPlanDetail',
            component: deploymentPlanDetail
          },
          {
            path: 'prodQueneDetail/:productId',
            name: 'prodQueneDetail',
            component: prodQueneDetail
          },
          {
            path: 'rhymePlanDetail/:productId',
            name: 'rhymePlanDetail',
            component: rhymePlanDetail
          },

          {
            path: 'organization',
            component: organization,
            children:[
              { path: 'list', component: organizationList },
              { path: 'post', component: PostManagement },
              { path: 'position', component: PositionManagement },
              { path: 'permission', component: PermissionManagement },
              { path: 'user', component: UserManagement },
              { path: 'user/invite', component: InviteUser },
              { path: 'user/permission', component: UserPermission },
              { path: 'production-management', component: ProductionManagement },
              { path: 'production-management/:categoryId', component: ProductionManagementEditor },
            ],
          },
        ]
  }, {
    path: '/login',
    component: login,
  }, {
    path: '/resetPassword',
    component: resetPassword,
  }, {
    path: '/signUp',
    component: signUp,
  }, {
    path: '/enterpriseSignUp',
    redirect: '/enterpriseSignUp/part1',
    component: enterpriseSignUp,
    children:[
      { path: 'part1', component: part1 },
      { path: 'part2', component: part2 },
      { path: 'part3', component: part3 },
    ],
  }]
})
